package com.dmxtechnologies.community.war;

import java.util.logging.Logger;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

import com.dmxtechnologies.community.ejb.interfaces.JWHIndexTimeBroadcastRemote;
import com.dmxtechnologies.community.rar.api.CMSBaseResponse;

@Named("cmsJWHAccessBean")
@RequestScoped
public class CMSJWHAccessBean extends CMSBaseAccessBean {
	private static final Logger log = Logger.getLogger("CMSJWHAccessBean");
	
	private CMSBaseResponse baseResponse;
	
	public CMSBaseResponse getBaseResponse() {
		return baseResponse;
	}

	public void setBaseResponse(CMSBaseResponse baseResponse) {
		this.baseResponse = baseResponse;
	}
	
	@EJB
	JWHIndexTimeBroadcastRemote jwhIndexTimeBroadcastRemote;

	@PostConstruct
	public void init() {
		log.info("enter");
		try {
			this.setCookie();
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {
			baseResponse = jwhIndexTimeBroadcastRemote.getJWHIndexList();
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
	}
}
